import { MergeConfigType, MergeConfigItem } from '@/components/FormPro/props';
import { getEditOrDetailConfig } from '@/components/FormPro/util';
import SignName from '@/components/SignName/index.vue';

export const getFormFileds = (type: MergeConfigType) => {
  const formBaseList: MergeConfigItem[] = [
    {
      label: '签字',
      filed: 'sign',
      props: {
        col: {
          span: 24,
        },
      },
      edit: {
        props: {
          component: {
            limit: 1,
          },
          formItem: {
            rules: [
              {
                required: true,
                trigger: 'change',
                message: '请签字',
              },
            ],
          },
        },
        component: SignName,
      },
    },
  ];

  return getEditOrDetailConfig(formBaseList, type);
};
